﻿using Customer.Domain;
using Customer.Infrstructre.FinanceManager;
using Customer.Read.API.Applcation.Command.FinanceTypeCommand;
using MediatR;

namespace Customer.Read.API.Applcation.CommandHandler.FinanceTypeCommandHandler
{
    /// <summary>
    /// 反填应收管理中介者
    /// </summary>
    public class FanReceivableCommandHandler:IRequestHandler<FanReceivableCommand,Receivable>
    {
        public readonly IReceivableRepository _receRep;

        public FanReceivableCommandHandler(IReceivableRepository receRep)
        {
            _receRep = receRep;
        }

        public async Task<Receivable> Handle(FanReceivableCommand request, CancellationToken cancellationToken)
        {
            return await _receRep.GetModelAsync(request.id);
        }
    }
}
